var windowName = "shopInsureMoney";
var Page,count = 0,list;
apiready = function(){
    onWindowShow(function () {
        if (count == 0) {
            count ++
        }else {
            list.reload();
            getData()
        }
    })
    onWindowHide(function () {
    })
    console.log("index page is OK");
    list = new List();
    Page = createVM("#Page",{       curTab:0
        ,page:{content:""}
        ,list:[]
        ,money:{m2:0}
    },{
        //页面方法
        "init":function () {
            var page = getLocData("INSURE_INTRO");
            if (isTrue(page)) {
                Page.page = page
            }
            var money = getLocData("money");
            if (isTrue(money)) {
                Page.money = money
            }
            list.setUrl("/api/my/moneyLogs").setData({m:2}).setCbFunc(function (res) {
                logJson(res);
                Page.list = res
            }).getList();

            getData()
        }
        ,tab:function (index) {
            log(index)
        }
    })
    Page.init()
}

function getData() {

    apiGet("/app/page",{code:"INSURE_INTRO"},function (res,code) {
        logJson(res,"page ——res")
        setLocData("INSURE_INTRO",res.data)
        Page.page = res.data
    })
    apiGet("/api/my/money",{},function (res,code) {
        logJson(res,"my money")
        setLocData("money",res.data)
        Page.money = res.data;
    })

}